<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>职位搜索-高级搜索</title>
<link type="text/css" rel="stylesheet" href="css/searchJob.css" />
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/searchJob.js"></script>
   <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
   <script type="text/javascript">
      $(document).ready(function () {
         var uid = localStorage.getItem("uid");
         var pname = localStorage.getItem("pname");
         // var pageNum = localStorage.getItem("pageNum");
         $("#input").val(pname);
         // var user = request.getParameter(user);
         $.get("Posts/selectlike",{"pname":pname},function (pageInfo) {
            $("tbody").empty();
            var pid;
            var apply;
            var list = pageInfo.list;
            $("#page1").text("共"+pageInfo.pages+"页   第"+pageInfo.pageNum+"/"+pageInfo.pages+"页");
            $("#page").text("共"+pageInfo.pages+"页   第"+pageInfo.pageNum+"/"+pageInfo.pages+"页");
            for (var i = 0; i <list.length ; i++) {
               if(list[i].apply=="立即申请"&&list[i].concern=="关注"){
                  $("<tr style=\"background: rgb(247, 248, 250)\">\n" +
                          "              <td>\n" +
                          "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"company\">\n" +
                          "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "              <td></td>\n" +
                          "              <td>'"+list[i].fullAddress+"'</td>\n" +
                          "              <td>'"+list[i].sal+"'</td>\n" +
                          "              <td>'"+list[i].lasttime+"'</td>\n" +
                          "           </tr>\n" +
                          "           <tr style=\"background: rgb(247, 248, 250)\" class=\"xxdetail none\">\n" +
                          "              <td colspan=\"5\">\n" +
                          "                 <div class=\"yaoqiu\">学历要求："+list[i].degree+" | 工作经验："+list[i].workexperience+" | 公司规模："+list[i].scale+" | 招聘方式：'"+list[i].recruittype+"'<br />\n" +
                          "                    岗位职责：'"+list[i].pduty+"'<br />\n" +
                          "                    岗位要求：'"+list[i].jrequest+"'</div>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"applydiv\">\n" +
                          "                    <a id='noapply' name='"+list[i].pid+"' class=\"ljsqbtn\">"+list[i].apply+"</a>\n" +
                          "                    <span id='noconcern' name="+list[i].pid+" >"+list[i].concern+"</span>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "           </tr>").appendTo("tbody");
               }else if(list[i].apply=="已申请"&& list[i].concern=="已关注"){
                  $("<tr>\n" +
                          "              <td>\n" +
                          "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"company\">\n" +
                          "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "              <td></td>\n" +
                          "              <td>'"+list[i].fullAddress+"'</td>\n" +
                          "              <td><span>'"+list[i].sal+"'</span></td>\n" +
                          "              <td>'"+list[i].lasttime+"'</td>\n" +
                          "           </tr>\n" +
                          "           <tr class=\"xxdetail none\">\n" +
                          "              <td colspan=\"5\">\n" +
                          "                 <div class=\"yaoqiu\">学历要求：'"+list[i].degree+"' | 工作经验：'"+list[i].workexperience+"' | 公司规模：'"+list[i].scale+"' | 招聘方式：'"+list[i].recruittype+"'<br /> \n" +
                          "岗位职责：'"+list[i].pduty+"'<br /> \n" +
                          "岗位要求：'"+list[i].jrequest+"'</div>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"applydiv\">\n" +
                          "                    <a id='isapply' name='"+list[i].pid+"' class=\"ysqbtn\">"+list[i].apply+"</a>\n" +
                          "                    <span id='isconcern' class=\"ygz\" name='"+list[i].pid+"'>'"+list[i].concern+"'</span>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "           </tr>").appendTo("tbody");
               }else if(list[i].apply=="立即申请"&& list[i].concern=="已关注"){
                  $("<tr style=\"background: rgb(247, 248, 250)\">\n" +
                          "              <td>\n" +
                          "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"company\">\n" +
                          "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "              <td></td>\n" +
                          "              <td>'"+list[i].fullAddress+"'</td>\n" +
                          "              <td>'"+list[i].sal+"'</td>\n" +
                          "              <td>'"+list[i].lasttime+"'</td>\n" +
                          "           </tr>\n" +
                          "           <tr style=\"background: rgb(247, 248, 250)\" class=\"xxdetail none\">\n" +
                          "              <td colspan=\"5\">\n" +
                          "                 <div class=\"yaoqiu\">学历要求：'"+list[i].degree+"' | 工作经验：'"+list[i].workexperience+"' | 公司规模：'"+list[i].scale+"' | 招聘方式：'"+list[i].recruittype+"'<br />\n" +
                          "                    岗位职责：'"+list[i].pduty+"'<br />\n" +
                          "                    岗位要求：'"+list[i].jrequest+"'</div>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"applydiv\">\n" +
                          "                    <a id='noapply' name='"+list[i].pid+"' class=\"ljsqbtn\">"+list[i].apply+"</a>\n" +
                          "                    <span id='isconcern' class=\"ygz\" name='"+list[i].pid+"'>'"+list[i].concern+"'</span>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "           </tr>").appendTo("tbody");

               }else {
                  $("<tr>\n" +
                          "              <td>\n" +
                          "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"company\">\n" +
                          "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "              <td></td>\n" +
                          "              <td>'"+list[i].fullAddress+"'</td>\n" +
                          "              <td><span>'"+list[i].sal+"'</span></td>\n" +
                          "              <td>'"+list[i].lasttime+"'</td>\n" +
                          "           </tr>\n" +
                          "           <tr class=\"xxdetail none\">\n" +
                          "              <td colspan=\"5\">\n" +
                          "                 <div class=\"yaoqiu\">学历要求：'"+list[i].degree+"' | 工作经验：'"+list[i].workexperience+"' | 公司规模：'"+list[i].scale+"' | 招聘方式：'"+list[i].recruittype+"'<br /> \n" +
                          "岗位职责：'"+list[i].pduty+"'<br /> \n" +
                          "岗位要求：'"+list[i].jrequest+"'</div>\n" +
                          "              </td>\n" +
                          "              <td>\n" +
                          "                 <div class=\"applydiv\">\n" +
                          "                    <a id='isapply' name='"+list[i].pid+"' class=\"ysqbtn\">"+list[i].apply+"</a>\n" +
                          "                    <span id='noconcern' name="+list[i].pid+">"+list[i].concern+"</span>\n" +
                          "                 </div>\n" +
                          "              </td>\n" +
                          "           </tr>").appendTo("tbody");
               }
            }
            $("[class = 'fenyediv']").empty();
            if(pageInfo.pageNum!=1){
               $("<a name='"+1+"' class='fy1'>首页</a>").appendTo("[class = 'fenyediv']");
               $("<a name='"+pageInfo.prePage+"' class='fy1'>上一页</a>").appendTo("[class = 'fenyediv']");
            }
            if(pageInfo.pageNum!=pageInfo.pages){
               $("<a name='"+pageInfo.nextPage+"' class='fy1'>下一页</a>").appendTo("[class = 'fenyediv']");
               $("<a name='"+pageInfo.pages+"' class='fy1'>尾页</a>").appendTo("[class = 'fenyediv']");
            }
         });
         $(document).on("click","[class='fy1']",function () {
            var pname=$("#input").val();
            var pageNum =$(this).attr("name");
            $.get("Posts/selectlike",{"pname":pname,"pageNum":pageNum},function (pageInfo) {
               $("tbody").empty();
               var pid;
               var apply;
               var list = pageInfo.list;
               $("#page1").text("共"+pageInfo.pages+"页   第"+pageInfo.pageNum+"/"+pageInfo.pages+"页");
               $("#page").text("共"+pageInfo.pages+"页   第"+pageInfo.pageNum+"/"+pageInfo.pages+"页");
               for (var i = 0; i <list.length ; i++) {
                  if(list[i].apply=="立即申请"&&list[i].concern=="关注"){
                     $("<tr style=\"background: rgb(247, 248, 250)\">\n" +
                             "              <td>\n" +
                             "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"company\">\n" +
                             "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "              <td></td>\n" +
                             "              <td>'"+list[i].fullAddress+"'</td>\n" +
                             "              <td>'"+list[i].sal+"'</td>\n" +
                             "              <td>'"+list[i].lasttime+"'</td>\n" +
                             "           </tr>\n" +
                             "           <tr style=\"background: rgb(247, 248, 250)\" class=\"xxdetail none\">\n" +
                             "              <td colspan=\"5\">\n" +
                             "                 <div class=\"yaoqiu\">学历要求："+list[i].degree+" | 工作经验："+list[i].workexperience+" | 公司规模："+list[i].scale+" | 招聘方式：'"+list[i].recruittype+"'<br />\n" +
                             "                    岗位职责：'"+list[i].pduty+"'<br />\n" +
                             "                    岗位要求：'"+list[i].jrequest+"'</div>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"applydiv\">\n" +
                             "                    <a id='noapply' name='"+list[i].pid+"' class=\"ljsqbtn\">"+list[i].apply+"</a>\n" +
                             "                    <span id='noconcern' name="+list[i].pid+">"+list[i].concern+"</span>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "           </tr>").appendTo("tbody");
                  }else if(list[i].apply=="已申请"&& list[i].concern=="已关注"){
                     $("<tr>\n" +
                             "              <td>\n" +
                             "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"company\">\n" +
                             "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "              <td></td>\n" +
                             "              <td>'"+list[i].fullAddress+"'</td>\n" +
                             "              <td><span>'"+list[i].sal+"'</span></td>\n" +
                             "              <td>'"+list[i].lasttime+"'</td>\n" +
                             "           </tr>\n" +
                             "           <tr class=\"xxdetail none\">\n" +
                             "              <td colspan=\"5\">\n" +
                             "                 <div class=\"yaoqiu\">学历要求：'"+list[i].degree+"' | 工作经验：'"+list[i].workexperience+"' | 公司规模：'"+list[i].scale+"' | 招聘方式：'"+list[i].recruittype+"'<br /> \n" +
                             "岗位职责：'"+list[i].pduty+"'<br /> \n" +
                             "岗位要求：'"+list[i].jrequest+"'</div>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"applydiv\">\n" +
                             "                    <a id='isapply' name='"+list[i].pid+"' class=\"ysqbtn\">"+list[i].apply+"</a>\n" +
                             "                    <span id='isconcern' class=\"ygz\" name='"+list[i].pid+"'>'"+list[i].concern+"'</span>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "           </tr>").appendTo("tbody");
                  }else if(list[i].apply=="立即申请"&& list[i].concern=="已关注"){
                     $("<tr style=\"background: rgb(247, 248, 250)\">\n" +
                             "              <td>\n" +
                             "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"company\">\n" +
                             "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "              <td></td>\n" +
                             "              <td>'"+list[i].fullAddress+"'</td>\n" +
                             "              <td>'"+list[i].sal+"'</td>\n" +
                             "              <td>'"+list[i].lasttime+"'</td>\n" +
                             "           </tr>\n" +
                             "           <tr style=\"background: rgb(247, 248, 250)\" class=\"xxdetail none\">\n" +
                             "              <td colspan=\"5\">\n" +
                             "                 <div class=\"yaoqiu\">学历要求：'"+list[i].degree+"' | 工作经验：'"+list[i].workexperience+"' | 公司规模：'"+list[i].scale+"' | 招聘方式：'"+list[i].recruittype+"'<br />\n" +
                             "                    岗位职责：'"+list[i].pduty+"'<br />\n" +
                             "                    岗位要求：'"+list[i].jrequest+"'</div>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"applydiv\">\n" +
                             "                    <a id='noapply' name='"+list[i].pid+"' class=\"ljsqbtn\">"+list[i].apply+"</a>\n" +
                             "                    <span id='isconcern' class=\"ygz\" name='"+list[i].pid+"'>'"+list[i].concern+"'</span>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "           </tr>").appendTo("tbody");

                  }else {
                     $("<tr>\n" +
                             "              <td>\n" +
                             "                 <a id='"+list[i].eid+"' name='"+list[i].pid+"' class=\"jobname\">'"+list[i].pname+"'</a>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"company\">\n" +
                             "                    <a name='"+list[i].eid+"' id='eid1'>'"+list[i].business+"'</a>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "              <td></td>\n" +
                             "              <td>'"+list[i].fullAddress+"'</td>\n" +
                             "              <td><span>'"+list[i].sal+"'</span></td>\n" +
                             "              <td>'"+list[i].lasttime+"'</td>\n" +
                             "           </tr>\n" +
                             "           <tr class=\"xxdetail none\">\n" +
                             "              <td colspan=\"5\">\n" +
                             "                 <div class=\"yaoqiu\">学历要求：'"+list[i].degree+"' | 工作经验：'"+list[i].workexperience+"' | 公司规模：'"+list[i].scale+"' | 招聘方式：'"+list[i].recruittype+"'<br /> \n" +
                             "岗位职责：'"+list[i].pduty+"'<br /> \n" +
                             "岗位要求：'"+list[i].jrequest+"'</div>\n" +
                             "              </td>\n" +
                             "              <td>\n" +
                             "                 <div class=\"applydiv\">\n" +
                             "                    <a id='isapply' name='"+list[i].pid+"' class=\"ysqbtn\">"+list[i].apply+"</a>\n" +
                             "                    <span id='noconcern' name="+list[i].pid+">"+list[i].concern+"</span>\n" +
                             "                 </div>\n" +
                             "              </td>\n" +
                             "           </tr>").appendTo("tbody");
                  }
               }
               $("[class = 'fenyediv']").empty();
               if(pageInfo.pageNum!=1){
                  $("<a name='"+1+"' class='fy1'>首页</a>").appendTo("[class = 'fenyediv']");
                  $("<a name='"+pageInfo.prePage+"' class='fy1'>上一页</a>").appendTo("[class = 'fenyediv']");
               }
               if(pageInfo.pageNum!=pageInfo.pages){
                  $("<a name='"+pageInfo.nextPage+"' class='fy1'>下一页</a>").appendTo("[class = 'fenyediv']");
                  $("<a name='"+pageInfo.pages+"' class='fy1'>尾页</a>").appendTo("[class = 'fenyediv']");
               }
            });

         });

         $(document).on("click","#noapply",function(){
            var apply = "已申请";
            var pid = $(this).attr("name");

            $.get("UserPosts/ApplyOk",{"apply":apply,"pid":pid},function (result) {
               if(result==true){
                  window.location.href="searchJob.html";
               }else {
                  alert("申请失败");
               }
            });
         });

         $(document).on("click","#isapply",function(){
            var apply = "立即申请";
            var pid = $(this).attr("name");

            $.get("UserPosts/ApplyNo",{"apply":apply,"pid":pid},function (result) {
               if(result==true){
                  window.location.href="searchJob.html";
               }else {
                  alert("申请失败");
               }
            });
         });

         $(document).on("click","#isconcern",function(){
            var concern = "关注";
            var pid = $(this).attr("name");
            alert("已关注-->关注");
            $.get("UserPosts/ConcernOk",{"concern":concern,"pid":pid},function (result) {
               if(result==true){
                  window.location.href="searchJob.html";
               }else {
                  alert("修改失败");
               }
            });
         });
         $(document).on("click","#noconcern",function(){
            var concern = "已关注";
            var pid = $(this).attr("name");
            alert("关注-->已关注");
            $.get("UserPosts/ConcernNo",{"concern":concern,"pid":pid},function (result) {
               if(result==true){
                  window.location.href="searchJob.html";
               }else {
                  alert("修改失败");
               }
            });
         });

         /**
          * 按关键词搜索
          */
         $("#search").click(function () {
            $("tbody").empty();
            var post1=$("#input").val();
            localStorage.setItem("pname",post1);
            window.location = "searchJob.html";

         });



         /**
          * 网页左上角logo，单击直接返回主页
          */
         $("#shouye").click(function () {
            window.location.href="index1.html";
         });


         /**
          * 给搜索页面每一行左边的职位关键词添加单击事件，单击进入职位详细信息页面，用过获取当前行的职位名称等信息，传回后台查询结果已封装类的形式传回职位招聘详细页面
          */
         $(document).on("click","[class='jobname']",function () {
            var eid= $(this).attr("id");
            localStorage.setItem("eid",eid);
            var pid= $(this).attr("name");
            localStorage.setItem("pid",pid);
            window.location.href="job_info.html";

         });

         /**
          *给搜索页面每一行左边的企业名称关键词添加单击事件，单击进入职位详细信息页面，用过获取当前行的职位名称等信息，传回后台查询结果已封装类的形式传回公司介绍页面
          */
         $(document).on("click","#eid1",function () {
            var eid= $(this).attr("name");
            localStorage.setItem("eid",eid);
            window.location.href="company.html";
         });
      });
   </script>
</head>

<body>
<div class="topDiv">
  <div class="topL">
     <div class="logo">
        <a id="shouye">
           <img src="images/LOGO.png" />
           <img src="images/view_logo40.png" class="img1"/>
        </a>
     </div>
     <img src="images/spirit_40.png" />
  </div>
  <div class="topR">
     <div class="topR0 topR2"><a href="register.html">注册</a></div>
     <div class="topR0 topR3"><a href="login.html">个人登录</a></div>
     <div class="clear"></div>
  </div>
</div>
<div class="menuDiv">
   <div class="mainWarp">
   </div>
</div>
<div class="clear"></div>
<div class="menuLittle">
</div>
<div class="clear"></div>
<div class="searchDiv">
  <div class="search1">
    <div class="sea1_1">
       <input id="input" name="job" type="text" placeholder="请填写关键词或选择职位" class="keyword"/>
       <span class="jiantou"></span>
    </div>
    <div class="sea1_4">
       <a id="search">搜工作</a>
    </div>
  </div>
</div>
<div class="clear"></div>
<div class="seachlist">
   <div class="listtop">
      <div class="tj1">
         <span id="list" class="list on">列表</span>
         <span id="little" class="zhaoyao">摘要</span>
      </div>
      <div class="tj3">
         <span id="page1">共1141条  第1/39页</span>
      </div>
   </div>
   <div class="clear"></div>
   <div class="listcon">
      <table border="0" width="100%" cellpadding="0" cellspacing="0" class="listtab">
         <thead>
           <tr>
              <th width="24%" style="padding-left:17px">职位名称</th>
              <th width="30%">企业名称</th>
              <th width="8%"></th>
              <th width="16%">工作地点</th>
              <th width="8%">薪水</th>
              <th width="10%">刷新时间</th>
           </tr>
         </thead>
         <tbody >

         </tbody>
      </table>
   </div>
   <div class="clear"></div>
   <div class="listbottom">
      <div id="page" class="lb3"><span>共1141条  第1/39页</span></div>
   </div>
   <div class="clear"></div>
   <div class="fenyediv">
      <a href="javascript:void(0)" class="fy1">首页</a>
      <a href="javascript:void(0)" class="fy1">上一页</a>
      <a href="javascript:void(0)" class="fy2 on">1</a>
      <a href="javascript:void(0)" class="fy2">2</a>
      <a href="javascript:void(0)" class="fy2">3</a>
      <a href="javascript:void(0)" class="fy2">4</a>
      <a href="javascript:void(0)" class="fy2">5</a>
      <a href="javascript:void(0)" class="fy2">6</a>
      <a href="javascript:void(0)" class="fy2">7</a>
      <a href="javascript:void(0)" class="fy2">8</a>
      <a href="javascript:void(0)" class="fy2">9</a>
      <a href="javascript:void(0)" class="fy2">10</a>
      <a href="javascript:void(0)" class="fy1">下一页</a>
      <a href="javascript:void(0)" class="fy1">尾页</a>
   </div>
   <div class="clear"></div>
</div>
<div class="clear"></div>
<div class="footer">
</div>
</body>
</html>
